Skip to content

Conversation

Cristib05
Copy link
Contributor

@Cristib05 Cristib05 commented Oct 6, 2025

This commit aims to move spinel related variables from heap to global arrays. Main reason behind this decision is that spinel variables are required for the entire lifetime of application.
In this way, HEAP_MEM_POOL_ADD_SIZE_ does not need to be defined, or updated, if any change in data structure might occur.

#endif
OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_TRANSMIT_RETRIES | OT_RADIO_CAPS_CSMA_BACKOFF;

inline void *operator new(size_t, void *p) noexcept {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it needed to override the standard new? But anyway, I see OT does the same, so maybe just reuse the one that OT uses?
https://github.com/zephyrproject-rtos/openthread/blob/2bc7712f57af22058770d1ef131ad3da79a0c764/src/include/common/new.hpp#L41

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this, I was not aware of it. I've overridden the new operator because app did not compile in our case, where PICOLIBC is enabled. Added header from OT and updated the PR.

@Cristib05 Cristib05 force-pushed the place_spinel_impl_on_global_memory branch from 573b9d1 to 91c33c5 Compare October 6, 2025 08:36
This commits aims to move spinel related variables from heap to global
arrays.
In this way, HEAP_MEM_POOL_ADD_SIZE_ does not need to be defined, or
updated if any change in data structure might occur.

Signed-off-by: Cristian Bulacu <[email protected]>
@Cristib05 Cristib05 force-pushed the place_spinel_impl_on_global_memory branch from 91c33c5 to 413af16 Compare October 6, 2025 08:52
Copy link

sonarqubecloud bot commented Oct 6, 2025

@kartben kartben merged commit d93b59b into zephyrproject-rtos:main Oct 8, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants